﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test_edited.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Certificate.test_edited" %>

<%@ Import Namespace="DataAccess" %>
<%@ Import Namespace="System.Linq" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<body>
    <% 
        int id = int.Parse(Request.QueryString["id"]);
        string name = Request.QueryString["name"];
        int cer = int.Parse(Request.QueryString["cer"]);
        int time = int.Parse(Request.QueryString["time"]);
        int check = int.Parse(Request.QueryString["check"]);
        string start = Request.QueryString["start"];
        string level = Request.QueryString["level"];
        int active = int.Parse(Request.QueryString["active"]);
        Nullable<DateTime> datetime = new Nullable<DateTime>();
        bool exam = true;
        if (check == 0)
            exam = false;
        bool act = true;
        if (active == 0)
            act = false;
        var get_test = new TblTestController().FetchAll().Where(x => x.TestId == id).Single();
        if (check == 0)
            new TblTestController().Update(id, name, cer, level, exam, get_test.TestCreator,datetime, time, act, "");
        else
            new TblTestController().Update(id, name, cer, level, exam, get_test.TestCreator, DateTime.Parse(start), time, act, "");
    %>
    <%=name%><div class="w3-hide test_id"><%=id %></div>
</body>
</html>
